<?
    include "../common.php" ;
    $tel = $_POST['tel'] ;
    $pwd = $_POST['pwd'] ;
    $sql = "SELECT * FROM `users` WHERE tel = {$tel} AND pwd = '{$pwd}'" ;
    $res = mysqli_query($link,$sql);
    $arr = [] ;
    $arr['sql'] = $sql ;
    if( mysqli_affected_rows($link) ){
        $one = mysqli_fetch_assoc($res) ;
        $arr['status'] = 1 ;
        $arr['info'] = '登录成功！' ; 
        $arr['data'] = $one ; 
    } else {
        $arr['status'] = 0 ;
        $arr['info'] = '登录名或密码错误！' ; 
    }
    echo json_encode($arr);
?>